#include <stdio.h>
#include <glob.h>

int main (int argc, char **argv)
{
	glob_t pg;
	if (0 != glob ("/etc/*", 0, NULL, &pg)){
		return -1;
	}
	//将所有的隐藏文件也找出来
	glob ("/etc/.*", GLOB_APPEND, NULL, &pg);
	for (int i = 0; i < pg.gl_pathc; i++) {
		puts ((pg.gl_pathv)[i]);
	}
	globfree (&pg);
	return 0;
}
